package com.pro.common.service.websocket.mq;

import com.pro.baoyi.common.api.BaoyiConst;
import com.pro.common.service.websocket.service.WebsocketEventService;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class WebsocketUserMqConsumer {

//    private final MqRabbitPublisher rabbitPublisher;
    @Autowired
    private WebsocketEventService websocketEventService;
    @RabbitListener(queues = BaoyiConst.RoutingKey_Queue.userToken_websocket)
    public void handlePayNotify(String tokenMd5) {
        websocketEventService.deleteCacheByToken(tokenMd5);
    }
}
